package com.ia.bikerecife;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

import com.ia.bikerecife.client.ClientResponderThread;

public class Server {
    private static final int PORTA = 7777;

    public static void main(String[] args) throws IOException {

        try {
//            TwitterResponder twitterListener = new TwitterResponder();
//            Timer tick = new Timer();
//            tick.schedule(twitterListener, 0, 30 * 1000);

            ServerSocket serverSocket = new ServerSocket(PORTA);
            System.out.println("Socket aberto na porta " + PORTA);

            while (true) {
                System.out.println("esperando ...");
                Socket socket = serverSocket.accept();
                
                System.out.println("conectou!");
                new ClientResponderThread(socket).start();
            }
        }
        catch (Exception e) {

        }

    }
}
